var app = getApp(), api = getApp().api;

Page({
    data: {},
    onLoad: function (t) {
        console.log('ttt', t)
        getApp().page.onLoad(this, t)
            if (t.type == 2) {
                var e = {
                    order_id: t.id,
                    type: "IN" //开心乐园
                    // type: "SP" //超惊喜
                }
            } else if (t.type == 3) {
                var e = {
                    order_id: t.inId,
                    // type: "IN" //开心乐园
                    type: "SP" //超惊喜
                }
            }else if(t.type == 8){
                var e = {
                    order_id: t.id,
                }
            } else {
                var e = {
                    order_id: t.id,
                    type: "mall"
                }
            }
        this.loadData(e,t.type);
    },
    loadData: function (t,q) {
        var e = this;
        if(q == 8){
            var ual = getApp().api.purchase.order_express_detail
        }else{
            var ual = getApp().api.order.express_detail
        }
        getApp().core.showLoading({
            title: "正在加载"
        }), getApp().request({
            url: ual,
            data: t,
            success: function (t) {
                getApp().core.hideLoading(), 0 == t.code && e.setData({
                    data: t.data
                });
                // if(t.data.status_text){
                //     t.data.status_text == '状态未知' && getApp().core.showModal({
                //         title: "提示",
                //         content: '当前快递未揽件，若长时间没有变化，请到‘我的’联系客服，为您解决。',
                //         showCancel: !1,
                //         success: function (t) {
                //             t.confirm && getApp().core.navigateBack();
                //         }
                //     })
                // };
                 1 == t.code && getApp().core.showModal({
                    title: "提示",
                    content: t.msg,
                    showCancel: !1,
                    success: function (t) {
                        t.confirm && getApp().core.navigateBack();
                    }
                });
            }
        });
    },
    onReady: function () {
        getApp().page.onReady(this);
    },
    onShow: function () {
        getApp().page.onShow(this);
    },
    onHide: function () {
        getApp().page.onHide(this);
    },
    onUnload: function () {
        getApp().page.onUnload(this);
    },
    onPullDownRefresh: function () { },
    onReachBottom: function () { },
    copyText: function (t) {
        var e = t.currentTarget.dataset.text;
        getApp().core.setClipboardData({
            data: e,
            success: function () {
                getApp().core.showToast({
                    title: "已复制"
                });
            }
        });
    }
});